Skip to main content

Fetch Notification Feed

Notification feed is a great way to populate notifications for a user. You can achieve the same with LikeMinds iOS SDK, by following the steps given below.

Steps to fetch notification feed

  1. Create a GetNotificationFeedRequest object using GetNotificationFeedRequest.builder() class by passing all the required parameters.
  2. Call getNotificationFeed() function using the instance of LMFeedClient.
  3. Process the response LMResponse<GetNotificationFeedResponse> as per your requirement.
// object of GetNotificationFeedRequest
let request = GetNotificationFeedRequest.builder()
.page(1) // page number for paginated notification feed data
.pageSize(10) // page size for paginated notification feed data
.build()
LMFeedClient.shared.getNotificationFeed(request) { response in
// response (LMResponse<GetNotificationFeedResponse>)
if (response.success) {
// your function to process the response data
processResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}

Models

GetNotificationFeedRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
pageIntPage number for paginated notification feed data.
pageSizeIntPage size for paginated notification feed data.

GetNotificationFeedResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
activitiesActivity[]List of activities inside notification feed.
users[String: User]Dictionary of UUID to user object.
topics[String, Topic]Map of topic id to topic object.